<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qtextformat.cpp -->
  <title>QTextBlockFormat Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QTextBlockFormat</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTextBlockFormat Class</h1>
<!-- $$$QTextBlockFormat-brief -->
<p>The QTextBlockFormat class provides formatting information for blocks of text in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
<!-- @@@QTextBlockFormat -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTextBlockFormat&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qtextformat.html">QTextFormat</a></td></tr></table></div><ul>
<li><a href="qtextblockformat-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are <a href="../qtdoc/threads-reentrancy.html">reentrant</a>.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a></b> { SingleHeight, ProportionalHeight, FixedHeight, MinimumHeight, LineDistanceHeight }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#MarkerType-enum">MarkerType</a></b> { NoMarker, Unchecked, Checked }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#QTextBlockFormat">QTextBlockFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#alignment">alignment</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#bottomMargin">bottomMargin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#headingLevel">headingLevel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#indent">indent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#leftMargin">leftMargin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#lineHeight">lineHeight</a></b>(qreal <i>scriptLineHeight</i>, qreal <i>scaling</i> = 1.0) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#lineHeight-1">lineHeight</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#lineHeightType">lineHeightType</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextBlockFormat::MarkerType </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#marker">marker</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#nonBreakableLines">nonBreakableLines</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextFormat::PageBreakFlags </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#pageBreakPolicy">pageBreakPolicy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#rightMargin">rightMargin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setAlignment">setAlignment</a></b>(Qt::Alignment <i>alignment</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a></b>(qreal <i>margin</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setHeadingLevel">setHeadingLevel</a></b>(int <i>level</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setIndent">setIndent</a></b>(int <i>indentation</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a></b>(qreal <i>margin</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setLineHeight">setLineHeight</a></b>(qreal <i>height</i>, int <i>heightType</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setMarker">setMarker</a></b>(QTextBlockFormat::MarkerType <i>marker</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a></b>(bool <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setPageBreakPolicy">setPageBreakPolicy</a></b>(QTextFormat::PageBreakFlags <i>policy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setRightMargin">setRightMargin</a></b>(qreal <i>margin</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setTabPositions">setTabPositions</a></b>(const QList&lt;QTextOption::Tab&gt; &amp;<i>tabs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setTextIndent">setTextIndent</a></b>(qreal <i>indent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#setTopMargin">setTopMargin</a></b>(qreal <i>margin</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QTextOption::Tab&gt; </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#tabPositions">tabPositions</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#textIndent">textIndent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtextblockformat.html#topMargin">topMargin</a></b>() const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QTextBlockFormat-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>A document is composed of a list of blocks, represented by <a href="qtextblock.html">QTextBlock</a> objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics.</p>
<p>To cater for left-to-right and right-to-left languages you can set a block's direction with setDirection(). Paragraph alignment is set with <a href="qtextblockformat.html#setAlignment">setAlignment</a>(). Margins are controlled by <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(). Overall indentation is set with <a href="qtextblockformat.html#setIndent">setIndent</a>(), the indentation of the first line with <a href="qtextblockformat.html#setTextIndent">setTextIndent</a>().</p>
<p>Line spacing is set with <a href="qtextblockformat.html#setLineHeight">setLineHeight</a>() and retrieved via <a href="qtextblockformat.html#lineHeight-1">lineHeight</a>() and <a href="qtextblockformat.html#lineHeightType">lineHeightType</a>(). The types of line spacing available are in the <a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a> enum.</p>
<p>Line breaking can be enabled and disabled with <a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a>().</p>
<p>The brush used to paint the paragraph's background is set with <a href="qtextformat.html#setBackground">setBackground()</a>, and other aspects of the text's appearance can be customized by using the <a href="qtextformat.html#setProperty">setProperty()</a> function with the <code>OutlinePen</code>, <code>ForegroundBrush</code>, and <code>BackgroundBrush</code> <a href="qtextformat.html#Property-enum">QTextFormat::Property</a> values.</p>
<p>If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function.</p>
</div>
<p><b>See also </b><a href="qtextblock.html">QTextBlock</a> and <a href="qtextcharformat.html">QTextCharFormat</a>.</p>
<!-- @@@QTextBlockFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$LineHeightTypes$$$SingleHeight$$$ProportionalHeight$$$FixedHeight$$$MinimumHeight$$$LineDistanceHeight -->
<h3 class="fn" id="LineHeightTypes-enum"><a name="LineHeightTypes-enum"></a>enum QTextBlockFormat::<span class="name">LineHeightTypes</span></h3>
<p>This enum describes the various types of line spacing support paragraphs can have.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::SingleHeight</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">This is the default line height: single spacing.</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::ProportionalHeight</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">This sets the spacing proportional to the line (in percentage). For example, set to 200 for double spacing.</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::FixedHeight</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">This sets the line height to a fixed line height (in pixels).</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::MinimumHeight</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">This sets the minimum line height (in pixels).</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::LineDistanceHeight</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">This adds the specified height between lines (in pixels).</td></tr>
</table></div>
<p>This enum was introduced or modified in Qt 4.8.</p>
<p><b>See also </b><a href="qtextblockformat.html#lineHeight-1">lineHeight</a>(), <a href="qtextblockformat.html#lineHeightType">lineHeightType</a>(), and <a href="qtextblockformat.html#setLineHeight">setLineHeight</a>().</p>
<!-- @@@LineHeightTypes -->
<!-- $$$MarkerType$$$NoMarker$$$Unchecked$$$Checked -->
<h3 class="fn" id="MarkerType-enum"><a name="MarkerType-enum"></a>enum QTextBlockFormat::<span class="name">MarkerType</span></h3>
<p>This enum describes the types of markers a list item can have. If a list item (a paragraph for which <a href="qtextblock.html#textList">QTextBlock::textList</a>() returns the list) has a marker, it is rendered instead of the normal bullet. In this way, checkable list items can be mixed with plain list items in the same list, overriding the type of bullet specified by the <a href="qtextlistformat.html#style">QTextListFormat::style</a>() for the entire list.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::NoMarker</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">This is the default: the list item's bullet will be shown.</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::Unchecked</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Instead of the list item's bullet, an unchecked checkbox will be shown.</td></tr>
<tr><td class="topAlign"><code>QTextBlockFormat::Checked</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Instead of the list item's bullet, a checked checkbox will be shown.</td></tr>
</table></div>
<p>In the future, this may be extended to specify other types of paragraph decorations.</p>
<p>This enum was introduced or modified in Qt 5.14.</p>
<p><b>See also </b><a href="qtextlistformat.html#style">QTextListFormat::style</a>().</p>
<!-- @@@MarkerType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextBlockFormat[overload1]$$$QTextBlockFormat -->
<h3 class="fn" id="QTextBlockFormat"><a name="QTextBlockFormat"></a>QTextBlockFormat::<span class="name">QTextBlockFormat</span>()</h3>
<p>Constructs a new QTextBlockFormat.</p>
<!-- @@@QTextBlockFormat -->
<!-- $$$alignment[overload1]$$$alignment -->
<h3 class="fn" id="alignment"><a name="alignment"></a><span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> QTextBlockFormat::<span class="name">alignment</span>() const</h3>
<p>Returns the paragraph's alignment.</p>
<p><b>See also </b><a href="qtextblockformat.html#setAlignment">setAlignment</a>().</p>
<!-- @@@alignment -->
<!-- $$$bottomMargin[overload1]$$$bottomMargin -->
<h3 class="fn" id="bottomMargin"><a name="bottomMargin"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">bottomMargin</span>() const</h3>
<p>Returns the paragraph's bottom margin.</p>
<p><b>See also </b><a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>() and <a href="qtextblockformat.html#topMargin">topMargin</a>().</p>
<!-- @@@bottomMargin -->
<!-- $$$headingLevel[overload1]$$$headingLevel -->
<h3 class="fn" id="headingLevel"><a name="headingLevel"></a><span class="type">int</span> QTextBlockFormat::<span class="name">headingLevel</span>() const</h3>
<p>Returns the paragraph's heading level if it is a heading, or 0 if not.</p>
<p>This function was introduced in Qt 5.12.</p>
<p><b>See also </b><a href="qtextblockformat.html#setHeadingLevel">setHeadingLevel</a>().</p>
<!-- @@@headingLevel -->
<!-- $$$indent[overload1]$$$indent -->
<h3 class="fn" id="indent"><a name="indent"></a><span class="type">int</span> QTextBlockFormat::<span class="name">indent</span>() const</h3>
<p>Returns the paragraph's indent.</p>
<p><b>See also </b><a href="qtextblockformat.html#setIndent">setIndent</a>().</p>
<!-- @@@indent -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QTextBlockFormat::<span class="name">isValid</span>() const</h3>
<p>Returns <code>true</code> if this block format is valid; otherwise returns false.</p>
<!-- @@@isValid -->
<!-- $$$leftMargin[overload1]$$$leftMargin -->
<h3 class="fn" id="leftMargin"><a name="leftMargin"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">leftMargin</span>() const</h3>
<p>Returns the paragraph's left margin.</p>
<p><b>See also </b><a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#rightMargin">rightMargin</a>(), and <a href="qtextblockformat.html#indent">indent</a>().</p>
<!-- @@@leftMargin -->
<!-- $$$lineHeight[overload1]$$$lineHeightqrealqreal -->
<h3 class="fn" id="lineHeight"><a name="lineHeight"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">lineHeight</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>scriptLineHeight</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>scaling</i> = 1.0) const</h3>
<p>Returns the height of the lines in the paragraph based on the height of the script line given by <i>scriptLineHeight</i> and the specified <i>scaling</i> factor.</p>
<p>The value that is returned is also dependent on the given <a href="qtextformat.html#Property-enum">LineHeightType</a> of the paragraph as well as the <a href="qtextformat.html#Property-enum">LineHeight</a> setting that has been set for the paragraph.</p>
<p>The scaling is needed for heights that include a fixed number of pixels, to scale them appropriately for printing.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a>, <a href="qtextblockformat.html#setLineHeight">setLineHeight</a>(), and <a href="qtextblockformat.html#lineHeightType">lineHeightType</a>().</p>
<!-- @@@lineHeight -->
<!-- $$$lineHeight$$$lineHeight -->
<h3 class="fn" id="lineHeight-1"><a name="lineHeight-1"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">lineHeight</span>() const</h3>
<p>This returns the <a href="qtextformat.html#Property-enum">LineHeight</a> property for the paragraph.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a>, <a href="qtextblockformat.html#setLineHeight">setLineHeight</a>(), and <a href="qtextblockformat.html#lineHeightType">lineHeightType</a>().</p>
<!-- @@@lineHeight -->
<!-- $$$lineHeightType[overload1]$$$lineHeightType -->
<h3 class="fn" id="lineHeightType"><a name="lineHeightType"></a><span class="type">int</span> QTextBlockFormat::<span class="name">lineHeightType</span>() const</h3>
<p>This returns the <a href="qtextformat.html#Property-enum">LineHeightType</a> property of the paragraph.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a>, <a href="qtextblockformat.html#setLineHeight">setLineHeight</a>(), and <a href="qtextblockformat.html#lineHeight-1">lineHeight</a>().</p>
<!-- @@@lineHeightType -->
<!-- $$$marker[overload1]$$$marker -->
<h3 class="fn" id="marker"><a name="marker"></a><span class="type"><a href="qtextblockformat.html#MarkerType-enum">QTextBlockFormat::MarkerType</a></span> QTextBlockFormat::<span class="name">marker</span>() const</h3>
<p>Returns the paragraph's marker if one has been set, or <code>NoMarker</code> if not.</p>
<p>This function was introduced in Qt 5.14.</p>
<p><b>See also </b><a href="qtextblockformat.html#setMarker">setMarker</a>().</p>
<!-- @@@marker -->
<!-- $$$nonBreakableLines[overload1]$$$nonBreakableLines -->
<h3 class="fn" id="nonBreakableLines"><a name="nonBreakableLines"></a><span class="type">bool</span> QTextBlockFormat::<span class="name">nonBreakableLines</span>() const</h3>
<p>Returns <code>true</code> if the lines in the paragraph are non-breakable; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a>().</p>
<!-- @@@nonBreakableLines -->
<!-- $$$pageBreakPolicy[overload1]$$$pageBreakPolicy -->
<h3 class="fn" id="pageBreakPolicy"><a name="pageBreakPolicy"></a><span class="type"><a href="qtextformat.html#PageBreakFlag-enum">QTextFormat::PageBreakFlags</a></span> QTextBlockFormat::<span class="name">pageBreakPolicy</span>() const</h3>
<p>Returns the currently set page break policy for the paragraph. The default is <a href="qtextformat.html#PageBreakFlag-enum">QTextFormat::PageBreak_Auto</a>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextblockformat.html#setPageBreakPolicy">setPageBreakPolicy</a>().</p>
<!-- @@@pageBreakPolicy -->
<!-- $$$rightMargin[overload1]$$$rightMargin -->
<h3 class="fn" id="rightMargin"><a name="rightMargin"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">rightMargin</span>() const</h3>
<p>Returns the paragraph's right margin.</p>
<p><b>See also </b><a href="qtextblockformat.html#setRightMargin">setRightMargin</a>() and <a href="qtextblockformat.html#leftMargin">leftMargin</a>().</p>
<!-- @@@rightMargin -->
<!-- $$$setAlignment[overload1]$$$setAlignmentQt::Alignment -->
<h3 class="fn" id="setAlignment"><a name="setAlignment"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setAlignment</span>(<span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i>)</h3>
<p>Sets the paragraph's <i>alignment</i>.</p>
<p><b>See also </b><a href="qtextblockformat.html#alignment">alignment</a>().</p>
<!-- @@@setAlignment -->
<!-- $$$setBottomMargin[overload1]$$$setBottomMarginqreal -->
<h3 class="fn" id="setBottomMargin"><a name="setBottomMargin"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setBottomMargin</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>margin</i>)</h3>
<p>Sets the paragraph's bottom <i>margin</i>.</p>
<p><b>See also </b><a href="qtextblockformat.html#bottomMargin">bottomMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), and <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>().</p>
<!-- @@@setBottomMargin -->
<!-- $$$setHeadingLevel[overload1]$$$setHeadingLevelint -->
<h3 class="fn" id="setHeadingLevel"><a name="setHeadingLevel"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setHeadingLevel</span>(<span class="type">int</span> <i>level</i>)</h3>
<p>Sets the paragraph's heading <i>level</i>, where 1 is the highest-level heading type (usually with the largest possible heading font size), and increasing values are progressively deeper into the document (and usually with smaller font sizes). For example when reading an HTML H1 tag, the heading level is set to 1. Setting the heading level does not automatically change the font size; however <a href="qtextdocumentfragment.html#fromHtml">QTextDocumentFragment::fromHtml</a>() sets both the heading level and the font size simultaneously.</p>
<p>If the paragraph is not a heading, the level should be set to 0 (the default).</p>
<p>This function was introduced in Qt 5.12.</p>
<p><b>See also </b><a href="qtextblockformat.html#headingLevel">headingLevel</a>().</p>
<!-- @@@setHeadingLevel -->
<!-- $$$setIndent[overload1]$$$setIndentint -->
<h3 class="fn" id="setIndent"><a name="setIndent"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setIndent</span>(<span class="type">int</span> <i>indentation</i>)</h3>
<p>Sets the paragraph's <i>indentation</i>. Margins are set independently of indentation with <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>() and <a href="qtextblockformat.html#setTextIndent">setTextIndent</a>(). The <i>indentation</i> is an integer that is multiplied with the document-wide standard indent, resulting in the actual indent of the paragraph.</p>
<p><b>See also </b><a href="qtextblockformat.html#indent">indent</a>() and <a href="qtextdocument.html#indentWidth-prop">QTextDocument::indentWidth</a>().</p>
<!-- @@@setIndent -->
<!-- $$$setLeftMargin[overload1]$$$setLeftMarginqreal -->
<h3 class="fn" id="setLeftMargin"><a name="setLeftMargin"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setLeftMargin</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>margin</i>)</h3>
<p>Sets the paragraph's left <i>margin</i>. Indentation can be applied separately with <a href="qtextblockformat.html#setIndent">setIndent</a>().</p>
<p><b>See also </b><a href="qtextblockformat.html#leftMargin">leftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<!-- @@@setLeftMargin -->
<!-- $$$setLineHeight[overload1]$$$setLineHeightqrealint -->
<h3 class="fn" id="setLineHeight"><a name="setLineHeight"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setLineHeight</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>, <span class="type">int</span> <i>heightType</i>)</h3>
<p>Sets the line height for the paragraph to the value given by <i>height</i> which is dependent on <i>heightType</i> in the way described by the <a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a> enum.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qtextblockformat.html#LineHeightTypes-enum">LineHeightTypes</a>, <a href="qtextblockformat.html#lineHeight-1">lineHeight</a>(), and <a href="qtextblockformat.html#lineHeightType">lineHeightType</a>().</p>
<!-- @@@setLineHeight -->
<!-- $$$setMarker[overload1]$$$setMarkerQTextBlockFormat::MarkerType -->
<h3 class="fn" id="setMarker"><a name="setMarker"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setMarker</span>(<span class="type"><a href="qtextblockformat.html#MarkerType-enum">QTextBlockFormat::MarkerType</a></span> <i>marker</i>)</h3>
<p>Sets the type of adornment that should be rendered alongside the paragraph to <i>marker</i>. For example, a list item can be adorned with a checkbox, either checked or unchecked, as a replacement for its bullet. The default is <code>NoMarker</code>.</p>
<p>This function was introduced in Qt 5.14.</p>
<p><b>See also </b><a href="qtextblockformat.html#marker">marker</a>().</p>
<!-- @@@setMarker -->
<!-- $$$setNonBreakableLines[overload1]$$$setNonBreakableLinesbool -->
<h3 class="fn" id="setNonBreakableLines"><a name="setNonBreakableLines"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setNonBreakableLines</span>(<span class="type">bool</span> <i>b</i>)</h3>
<p>If <i>b</i> is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.</p>
<p><b>See also </b><a href="qtextblockformat.html#nonBreakableLines">nonBreakableLines</a>().</p>
<!-- @@@setNonBreakableLines -->
<!-- $$$setPageBreakPolicy[overload1]$$$setPageBreakPolicyQTextFormat::PageBreakFlags -->
<h3 class="fn" id="setPageBreakPolicy"><a name="setPageBreakPolicy"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setPageBreakPolicy</span>(<span class="type"><a href="qtextformat.html#PageBreakFlag-enum">QTextFormat::PageBreakFlags</a></span> <i>policy</i>)</h3>
<p>Sets the page break policy for the paragraph to <i>policy</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtextblockformat.html#pageBreakPolicy">pageBreakPolicy</a>().</p>
<!-- @@@setPageBreakPolicy -->
<!-- $$$setRightMargin[overload1]$$$setRightMarginqreal -->
<h3 class="fn" id="setRightMargin"><a name="setRightMargin"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setRightMargin</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>margin</i>)</h3>
<p>Sets the paragraph's right <i>margin</i>.</p>
<p><b>See also </b><a href="qtextblockformat.html#rightMargin">rightMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<!-- @@@setRightMargin -->
<!-- $$$setTabPositions[overload1]$$$setTabPositionsconstQList<QTextOption::Tab>& -->
<h3 class="fn" id="setTabPositions"><a name="setTabPositions"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setTabPositions</span>(const <span class="type">QList</span>&lt;<span class="type"><a href="qtextoption-tab.html">QTextOption::Tab</a></span>&gt; &amp;<i>tabs</i>)</h3>
<p>Sets the tab positions for the text block to those specified by <i>tabs</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextblockformat.html#tabPositions">tabPositions</a>().</p>
<!-- @@@setTabPositions -->
<!-- $$$setTextIndent[overload1]$$$setTextIndentqreal -->
<h3 class="fn" id="setTextIndent"><a name="setTextIndent"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setTextIndent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>indent</i>)</h3>
<p>Sets the <i>indent</i> for the first line in the block. This allows the first line of a paragraph to be indented differently to the other lines, enhancing the readability of the text.</p>
<p><b>See also </b><a href="qtextblockformat.html#textIndent">textIndent</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<!-- @@@setTextIndent -->
<!-- $$$setTopMargin[overload1]$$$setTopMarginqreal -->
<h3 class="fn" id="setTopMargin"><a name="setTopMargin"></a><span class="type">void</span> QTextBlockFormat::<span class="name">setTopMargin</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>margin</i>)</h3>
<p>Sets the paragraph's top <i>margin</i>.</p>
<p><b>See also </b><a href="qtextblockformat.html#topMargin">topMargin</a>(), <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), and <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>().</p>
<!-- @@@setTopMargin -->
<!-- $$$tabPositions[overload1]$$$tabPositions -->
<h3 class="fn" id="tabPositions"><a name="tabPositions"></a><span class="type">QList</span>&lt;<span class="type"><a href="qtextoption-tab.html">QTextOption::Tab</a></span>&gt; QTextBlockFormat::<span class="name">tabPositions</span>() const</h3>
<p>Returns a list of tab positions defined for the text block.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qtextblockformat.html#setTabPositions">setTabPositions</a>().</p>
<!-- @@@tabPositions -->
<!-- $$$textIndent[overload1]$$$textIndent -->
<h3 class="fn" id="textIndent"><a name="textIndent"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">textIndent</span>() const</h3>
<p>Returns the paragraph's text indent.</p>
<p><b>See also </b><a href="qtextblockformat.html#setTextIndent">setTextIndent</a>().</p>
<!-- @@@textIndent -->
<!-- $$$topMargin[overload1]$$$topMargin -->
<h3 class="fn" id="topMargin"><a name="topMargin"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QTextBlockFormat::<span class="name">topMargin</span>() const</h3>
<p>Returns the paragraph's top margin.</p>
<p><b>See also </b><a href="qtextblockformat.html#setTopMargin">setTopMargin</a>() and <a href="qtextblockformat.html#bottomMargin">bottomMargin</a>().</p>
<!-- @@@topMargin -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
